package com.ycMc.common.bean;

import com.ycMc.constant.CommonConstant;
import lombok.Data;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by libo2 on 2017/8/21.
 */
@Data
public class Request {

    private String userId;

    private int userLevel;

    private int currentPage;

    private int pageSize;

    private String keyword;

    private int ContainZero;

    private HttpServletRequest request;

    public int getContainZero() {
        return ContainZero;
    }

    public void setContainZero(int containZero) {
        ContainZero = containZero;
    }

    public Request() {
    }


    public Response validate(HttpServletRequest request) {
        if (request.getSession().getAttribute("user")==null) {
            Response response = Response.build(Response.NOT_LOGIN, CommonConstant.NOT_LOGIN);
            return response;
        }
        return null;
    }



}
